import { defHttp } from '@/utils/http/axios';
import {
  DeviceTypeListItem,
  DataListItem,
  DataTypeListItem,
  ClassifyListItem,
  RecordTypeListItem,
  DeptListGetResultModel,
  DeviceParams,
  DeviceListGetResultModel,
  DataListGetResultModel,
  DataTypeListGetResultModel,
  ClassifyListGetResultModel,
  RecordTypeListGetResultModel,
} from './model/collectionModel';

enum Api {
  DeviceTypeList = '/collection/getDeviceTypeList',
  DeviceList = '/collection/getDeviceList',
  DataList = '/collection/getDataList',
  DataTypeList = '/collection/getDataTypeList',
  ClassifyList = '/collection/getClassifyList',
  RecordTypeList = '/collection/getRecordTypeList',
}

export const getDeviceTypeList = (params?: DeviceTypeListItem) =>
  defHttp.get<DeptListGetResultModel>({ url: Api.DeviceTypeList, params });
export const getDeviceList = (params: DeviceParams) =>
  defHttp.get<DeviceListGetResultModel>({ url: Api.DeviceList, params });
export const getDataList = (params?: DataListItem) =>
  defHttp.get<DataListGetResultModel>({ url: Api.DataList, params });
export const getDataTypeList = (params?: DataTypeListItem) =>
  defHttp.get<DataTypeListGetResultModel>({ url: Api.DataTypeList, params });
export const getClassifyList = (params?: ClassifyListItem) =>
  defHttp.get<ClassifyListGetResultModel>({ url: Api.ClassifyList, params });
export const getRecordTypeList = (params?: RecordTypeListItem) =>
  defHttp.get<RecordTypeListGetResultModel>({ url: Api.RecordTypeList, params });
